-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to use different TSIG algorithms #626
Conversation
Codecov Report
@@ Coverage Diff @@
## master #626 +/- ##
==========================================
- Coverage 58.23% 58.07% -0.17%
==========================================
Files 37 37
Lines 10122 10161 +39
==========================================
+ Hits 5895 5901 +6
- Misses 3171 3202 +31
- Partials 1056 1058 +2
Continue to review full report at Codecov.
|
@bodgit I doubt such a breaking change would be accepted into the library. I see no reason why the meta argument, and thus this breaking change, is needed at all. What's stopping you from just using a closure? You can just pass |
The problem is that I agree this breaks the library (although all libraries get a major version bump eventually) so I could add another field such as |
before I actually review +1 to @tmthrgd 's comment. Even if it's a "cgo pointer" you can probably get away with it being converted to string (however bad that is). |
Also note: we try hard to not break backwards compat, even if that puts us in a bad state code wise. library versioning is not a reason to start breaking compat now |
I opened bodgit#1 to demonstrate my suggestion:
I make no particular comment on this pull-request (#626) or whether it should be merged, but it is definitely possible to achieve the desired aim without introducing any breaking changes. |
master...tmthrgd:gss-tsig would be the final diff if @bodgit accepts my suggestion. |
If that's possible, then that could work. When I print my GSSAPI context out with
I'm struggling to work out how to serialize that to and from a string. |
I've merged @tmthrgd's PR into mine, so there should now be no compat breakage. |
A few other nits: Are In bodgit#1 you mention:
Perhaps the |
I've had a need to be able verify externally outside of the library; part of the TKEY negotiation includes a TSIG in the final response from the server which needs to be checked after the library would normally do it as the GSSAPI context needs to first be updated with the contents from that same TKEY response. Generate less so, but maybe someone else has a use for that. The existing
I don't think there are. Removing the check will mean an algorithm callback will always be passed at least an empty string so the onus is on that code to check that I will have a look at the server code now, I admit I overlooked it. |
I'll to free up some cycles to review this - lots of other dns work pushed this backward. |
Anything I can do to progress this? |
Sorry, just coming back to this after much work on CoreDNS. Why do we need I though in the long discussion we have about this that we could get away with a non-breaking backwards compat change and just having some closures? I also (apparently) made it not clear enough that backward breaking changes for just this feature are not going to happen. I.e. new members in Client and Server can work, but changing existing fields and types will not fly. |
Can you show me where I've broken backwards compat? I don't believe I have (now). Originally I did by changing the |
@miekg, can you possibly confer with @tmthrgd as I think he's happy there's no compat breakage. Other than that, I'd just like to know what to do with the server code I pointed out and if I should relax the secret check as suggested in #626 (comment) |
This commit removes the interface{} 'meta' argument, which required breaking the signature of TsigSecret, and instead passes the name directly to the callback. If there is a need to use a non-string secret, this can be looked up from within a closure using the name as a lookup key. This change still permits all the same use-cases as it's parent.
Can this be reopened? I'd still like to get this functionality in and @tmthrgd seemed happy with it. I'm not sure how many times I could point out that I'm only adding new members and not changing existing ones. |
Sure. Didn't recall we where still discussing this...
…On Fri, 4 Jan 2019, 09:15 Matt Dainty ***@***.*** wrote:
Can this be reopened? I'd still like to get this functionality in and
@tmthrgd <https://github.com/tmthrgd> seemed happy with it. I'm not sure
how many times I could point out that I'm only adding new members and not
changing existing ones.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#626 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAVkWyxbB53_GLw-W1AcCnnbO8d58WXsks5u_xuUgaJpZM4RZ6I_>
.
|
I'm trying to but you keep ignoring my requests for feedback 🤷♂️ I'm happy to bend this into whatever shape is necessary so it works, I'm not changing any existing members or types, only adding new ones. So the only other question is regarding using closures, can you give me an example of how you think that would work that's better than how I've currently done it with callbacks? |
@miekg Can this get reopened? Would like to get GSS-TSIG support |
[ Quoting <[email protected]> in "Re: [miekg/dns] Add ability to use ..." ]
Can this get reopened? Would like to get GSS-TSIG support
yes, sure, with these caveats:
* NO BACKWARDS INCOMPATIBLE changes
* NO BLOATING of current datastructures to accommodate the changes
Once you have a PR that does that, we can discuss further. If not, then no
|
I've asked you repeatedly to show me where such changes were in the latest version of the code, not in the first commits which were subsequently fixed thanks to @tmthrgd.
Quoting yourself:
So can I add new members, or is that bloating things? Please make your mind up. The problem is the generation and verification of TSIG is done inside the library so there needs to be some way of being able to inject additional TSIG algorithms because as it currently stands if the algorithm used is not one of MD5, SHA1, SHA256 or SHA512 the library will always return |
I'm done with this feature. Sorry.
|
This makes it possible to fix #549 and support GSS-TSIG (or in theory any other TSIG algorithms aside from HMAC-MD5, etc.). There is one breaking change in that the TsigSecret field is now a map of value
interface{}
rather thanstring
. I've added two new functionsTsigGenerateByAlgorithm()
andTsigVerifyByAlgorithm()
which allow an algorithm-specific callback and refactored the existingTsigGenerate()
andTsigVerify()
to just call these with callback functions that perform the HMAC-specific bits.With this, GSS-TSIG can be done with something like the following:
negotiateGssapiCtx
does the TKEY exchange to establish the GSSAPI context and myTsigGenerateGssapi
&TsigVerifyGssapi
are pretty much the same as in #549 (comment) the only difference is that the generate callback is now also passed the TSIG algorithm.